# Contributor: Jakub Jirutka <jakub@jirutka.cz>
# Maintainer: Jakub Jirutka <jakub@jirutka.cz>
pkgname=ruby-perfect_toml
_gemname=perfect_toml
pkgver=0.9.0
pkgrel=1
pkgdesc="A fast TOML parser gem fully compliant with TOML v1.0.0"
url="https://github.com/mame/perfect_toml"
arch="noarch"
license="MIT"
depends="ruby"
checkdepends="ruby-test-unit"
source="https://github.com/mame/perfect_toml/archive/v$pkgver/ruby-perfect_toml-$pkgver.tar.gz
	no-simplecov.patch
	gemspec.patch
	"
builddir="$srcdir/$_gemname-$pkgver"

build() {
	gem build $_gemname.gemspec
}

check() {
	ruby -I 'lib:test' -e 'Dir.glob "./test/**_test.rb", &method(:require)'
}

package() {
	local gemdir="$pkgdir/$(ruby -e 'puts Gem.default_dir')"

	gem install --local \
		--install-dir "$gemdir" \
		--ignore-dependencies \
		--no-document \
		--verbose \
		$_gemname

	rm -r "$gemdir"/build_info \
		"$gemdir"/cache \
		"$gemdir"/doc \
		"$gemdir"/plugins
}

sha512sums="
36e2189dc1ded8008be1e6314c4f92d834e3b8493491eef7f599851116ffdb6f69c9bce46ae9bfb4a2ccfed0fc5bd8319089eb7a5fe8381848316544f73417ad  ruby-perfect_toml-0.9.0.tar.gz
60d699ba5760b671e36bfaab7e591d199d03e88e614296bc728ffb0a11c1047eccd2b37a6454b84c59352f2bb941836e755f2b905cfcdb9d6c140071202db199  no-simplecov.patch
50c34752f79ed1332927cf0491d9f1d6b25919f4209cbcc0d920aaa5e14dbd0abf6f0375cc2d6dffd94c6707bdc1d0a8b628c9005988d62bd2437fcc741a4393  gemspec.patch
"
